﻿namespace HySoft.Cash.BaseClass
{
    using System;

    public class CommonMethods
    {
        public static string CaculateWeekDay(int y, int m, int d)
        {
            if (m == 1)
            {
                m = 13;
            }
            if (m == 2)
            {
                m = 14;
            }
            int num = ((((((d + (2 * m)) + ((3 * (m + 1)) / 5)) + y) + (y / 4)) - (y / 100)) + (y / 400)) % 7;
            switch (num)
            {
                case 1:
                    return "星期一";

                case 2:
                    return "星期二";

                case 3:
                    return "星期三";

                case 4:
                    return "星期四";

                case 5:
                    return "星期五";

                case 6:
                    return "星期六";

                case 7:
                    return "星期日";
            }
            return "";
        }
    }
}

